{
    init: function(elevators, floors) {
        console.log('elevators',elevators);
        console.log('floors',floors);
        var eindex;
        for(eindex=0;eindex<elevators.length;eindex++){
            //var elevator = elevators[eindex]; // Let's use the first elevator

            // Whenever the elevator is idle (has no more queued destinations) ...
            elevators[eindex].on("idle", function() {
                  console.log('elevator idle of ',eindex,this)
                // let's go to all the floors (or did we forget one?)
                this.goToFloor(0);
            });
            elevators[eindex].on("floor_button_pressed", function(floorNum) {
                this.goToFloor(floorNum);
            } );
            elevators[eindex].on("stopped_at_floor", function(floorNum) {
                // Maybe decide where to go next?
            });
            elevators[eindex].on("passing_floor", function(floorNum, direction) { 
            });
        }

        var findex;
        for(findex=0;findex<floors.length;findex++){
            //var floor=floors[findex];
            floors[findex].on("up_button_pressed", function() { 
                //elevator.goToFloor(floor.floorNum());
            });
            floors[findex].on("down_button_pressed", function() {
                //elevator.goToFloor(floor.floorNum());
            });
        }
    },
        update: function(dt, elevators, floors) {
            // We normally don't need to do anything here
        }
}